Skip to content

Add basic TypeScript coverage for engine names and core search parameters#42

Draft
nya-a-cat wants to merge 1 commit into
serpapi:masterfrom
nya-a-cat:fix-basic-types-engine-names
Draft

Add basic TypeScript coverage for engine names and core search parameters#42
nya-a-cat wants to merge 1 commit into
serpapi:masterfrom
nya-a-cat:fix-basic-types-engine-names

Conversation

@nya-a-cat

@nya-a-cat nya-a-cat commented Jun 28, 2026

Copy link
Copy Markdown

Summary

  • Add an EngineName union for documented SerpApi engine names.
  • Replace the previous unbounded EngineParameters = Record<string, any> surface with a minimal typed layer for core search parameters, while still allowing engine-specific query parameters that are not modeled yet.
  • Type the getJson and getHtml overloads so both object-form and legacy engine-first calls validate engine names.
  • Add TypeScript compile coverage and a README TypeScript example.

This is intentionally not a full engine-specific schema pass. It creates a lowest-level verifiable TypeScript foundation first: engine names and common Search API parameters are typed, while per-engine parameter schemas can be added incrementally later.

Validation

  • deno fmt --check
  • deno check tests/types_test.ts
  • deno task test
  • deno task npm
  • git diff --check

Note: deno lint currently fails on the existing inline https://deno.land/... imports under Deno 2's no-import-prefix rule, so this PR leaves lint configuration unchanged.

Fixes #33

@nya-a-cat nya-a-cat closed this Jun 28, 2026
@nya-a-cat nya-a-cat reopened this Jun 28, 2026
@nya-a-cat nya-a-cat force-pushed the fix-basic-types-engine-names branch from 63d9d1d to 9d08fff Compare June 28, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

types are extremely poor without coverage.

1 participant